package com.nanrui.mutualinductor.data;



public class Gear
{
    private int defaultIdxXT;
    private short defaultIndex;
    private float[] gears;
    private String[] gearsString;
    private String unit;

    public Gear() {}

    public Gear(float[] paramArrayOfFloat, String paramString, short paramShort, int paramInt)
    {
        this.gears = paramArrayOfFloat;
        this.unit = paramString;
        this.defaultIndex = ((short)paramShort);
        this.defaultIdxXT = paramInt;
        this.gearsString = new String[paramArrayOfFloat.length];
        for (paramShort = 0; paramShort < paramArrayOfFloat.length; paramShort++) {
            this.gearsString[paramShort] = Objects.displayValue(Float.valueOf(paramArrayOfFloat[paramShort]), paramString);
        }
    }

    public Gear(float[] paramArrayOfFloat, short paramShort, int paramInt)
    {
        this(paramArrayOfFloat, null, paramShort, paramInt);
    }

    public int getDefaultIdxXT()
    {
        return this.defaultIdxXT;
    }

    public short getDefaultIndex()
    {
        return this.defaultIndex;
    }

    public float[] getGears()
    {
        return this.gears;
    }

    public String[] getGearsString()
    {
        return this.gearsString;
    }

    public short getIndex(float paramFloat)
    {
        int i = 0;
        for (int j = i; j < this.gears.length; j = i)
        {
            if (paramFloat == this.gears[j]) {
                return (short) j;
            }
            i = (short)(j + 1);
        }
        //修改过
        return (short) i;
    }

    public Gear setDefaultIndex(short paramShort)
    {
        this.defaultIndex = ((short)paramShort);
        return this;
    }

    public Gear setGears(float[] paramArrayOfFloat)
    {
        this.gears = paramArrayOfFloat;
        this.gearsString = new String[paramArrayOfFloat.length];
        for (int i = 0; i < paramArrayOfFloat.length; i++) {
            this.gearsString[i] = Objects.displayValue(Float.valueOf(paramArrayOfFloat[i]), this.unit);
        }
        return this;
    }
}
